﻿//TODO: implement, ShiTomasi

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Drawing;
using System.Drawing.Imaging;

namespace LowLevelGraphics.Filter
{
    /// <summary>
    ///The Shi and Tomasi corner detection algorithm
    ///Note that this is also sometimes referred to as the Kanade-Tomasi corner detector.
    ///The corner detector is strongly based on the Harris corner detector.
    ///The authors show that for image patches undergoing affine transformations, min(λ1,λ2) 
    ///is a better measure of corner strength than Mc.    
    /// </summary>
    public class ShiTomasi : BaseImageFilter, ICornerFinder
    {
        protected List<Point> m_aPoint = new List<Point>();

        public ShiTomasi()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ShiTomasi"/> class.
        /// </summary>
        /// <param name="_shiTomasi">The _shi tomasi.</param>
        internal ShiTomasi(ShiTomasi _shiTomasi)
        {
        }

        /// <summary>
        /// Gets the points
        /// </summary>
        public List<Point> Points
        {
            get { return m_aPoint; }
        }

        /// <summary>
        /// Execute this Filter
        /// A Debug Statement is written if a concrete Filter is called
        /// </summary>
        /// <param name="_bitmap"></param>
        /// <returns></returns>
        public override UnsafeBitmap Execute(UnsafeBitmap _bitmap)
        {
            base.Execute(_bitmap);
            return _bitmap;
        }

        /// <summary>
        /// This is used to clone a filter, each filter must implement it's own clone functionality
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            return new ShiTomasi(this);
        }
    }
}
